home *** CD-ROM | disk | FTP | other *** search
/ NOVA - For the NeXT Workstation / NOVA - For the NeXT Workstation.iso / Documents / NeXTAnswers / objc.808 < prev    next >
Text File  |  1992-02-06  |  4KB  |  104 lines

  1. {\rtf0\ansi{\fonttbl\f0\fnil Times-Roman;\f1\fswiss Helvetica;}
  2. \paperw12400
  3. \paperh9240
  4. \margl120
  5. \margr1000
  6. {\colortbl\red0\green0\blue0;}
  7. \pard\tx1140\tx2300\tx3440\tx4600\tx5760\tx6900\tx8060\tx9200\tx10360\tx11520\f0\b0\i0\ul0\fs28\fc0 size types storage\
  8.  
  9. \pard\tx960\tx1920\tx2880\tx3840\tx4800\tx5760\tx6720\tx7680\tx8640\tx9600 \
  10. Q:  How many bytes of storage do the various fundamental data types take in the NeXT implementation?\
  11. \
  12. Q: What are the maximum and minimum values for the various arithmetic data types?\
  13. \
  14. A:  \
  15. TYPE            SIZE            MINIMUM      MAXIMUM\
  16.  
  17. \b char
  18. \b0             1 byte = 8 bits        -128          127\
  19.  
  20. \b unsigned char
  21. \b0         1 byte = 8 bits        0          255\
  22.  
  23. \b short
  24. \b0             2 bytes = 16 bits        
  25. \pard\tx1140\tx2300\tx3440\tx4600\tx5760\tx6900\tx8060\tx9200\tx10360\tx11520\fc0 -32768
  26. \pard\tx960\tx1920\tx2880\tx3840\tx4800\tx5760\tx6720\tx7680\tx8640\tx9600\fc0           
  27. \pard\tx1140\tx2300\tx3440\tx4600\tx5760\tx6900\tx8060\tx9200\tx10360\tx11520\fc0 3276
  28. \pard\tx960\tx1920\tx2880\tx3840\tx4800\tx5760\tx6720\tx7680\tx8640\tx9600\fc0 7\
  29.  
  30. \b unsigned short
  31. \b0         2 bytes = 16 bits        0          
  32. \pard\tx1140\tx2300\tx3440\tx4600\tx5760\tx6900\tx8060\tx9200\tx10360\tx11520\fc0 65535
  33. \pard\tx960\tx1920\tx2880\tx3840\tx4800\tx5760\tx6720\tx7680\tx8640\tx9600 \
  34.  
  35. \b int
  36. \b0             4 bytes = 32 bits        
  37. \pard\tx1140\tx2300\tx3440\tx4600\tx5760\tx6900\tx8060\tx9200\tx10360\tx11520\fc0 -2147483648
  38. \pard\tx960\tx1920\tx2880\tx3840\tx4800\tx5760\tx6720\tx7680\tx8640\tx9600       
  39. \pard\tx1140\tx2300\tx3440\tx4600\tx5760\tx6900\tx8060\tx9200\tx10360\tx11520\fc0 2147483647
  40. \pard\tx960\tx1920\tx2880\tx3840\tx4800\tx5760\tx6720\tx7680\tx8640\tx9600 \
  41.  
  42. \b long    
  43. \b0         4 bytes = 32 bits        
  44. \pard\tx1140\tx2300\tx3440\tx4600\tx5760\tx6900\tx8060\tx9200\tx10360\tx11520\fc0 -2147483648
  45. \pard\tx960\tx1920\tx2880\tx3840\tx4800\tx5760\tx6720\tx7680\tx8640\tx9600       
  46. \pard\tx1140\tx2300\tx3440\tx4600\tx5760\tx6900\tx8060\tx9200\tx10360\tx11520\fc0 2147483647
  47. \pard\tx960\tx1920\tx2880\tx3840\tx4800\tx5760\tx6720\tx7680\tx8640\tx9600 \
  48.  
  49. \b unsigned int
  50. \b0     
  51. \b     
  52. \b0 4 bytes = 32 bits        0          
  53. \pard\tx1140\tx2300\tx3440\tx4600\tx5760\tx6900\tx8060\tx9200\tx10360\tx11520\fc0 4294967295
  54. \pard\tx960\tx1920\tx2880\tx3840\tx4800\tx5760\tx6720\tx7680\tx8640\tx9600 \
  55.  
  56. \b unsigned long        
  57. \b0 4 bytes = 32 bits        0          
  58. \pard\tx1140\tx2300\tx3440\tx4600\tx5760\tx6900\tx8060\tx9200\tx10360\tx11520\fc0 4294967295
  59. \pard\tx960\tx1920\tx2880\tx3840\tx4800\tx5760\tx6720\tx7680\tx8640\tx9600 \
  60.  
  61. \b float        
  62. \b0      4 bytes = 32 bits        
  63. \pard\tx1140\tx2300\tx3440\tx4600\tx5760\tx6900\tx8060\tx9200\tx10360\tx11520\fc0 1.17549435e-38f
  64. \pard\tx960\tx1920\tx2880\tx3840\tx4800\tx5760\tx6720\tx7680\tx8640\tx9600   
  65. \pard\tx1140\tx2300\tx3440\tx4600\tx5760\tx6900\tx8060\tx9200\tx10360\tx11520\fc0 3.40282347e+38f
  66. \pard\tx960\tx1920\tx2880\tx3840\tx4800\tx5760\tx6720\tx7680\tx8640\tx9600 \
  67.  
  68. \b double
  69. \b0             8 bytes = 64 bits        
  70. \pard\tx1140\tx2300\tx3440\tx4600\tx5760\tx6900\tx8060\tx9200\tx10360\tx11520\fc0 2.225073858507201e-308
  71. \pard\tx960\tx1920\tx2880\tx3840\tx4800\tx5760\tx6720\tx7680\tx8640\tx9600\fc0 \
  72.                               
  73. \pard\tx1140\tx2300\tx3440\tx4600\tx5760\tx6900\tx8060\tx9200\tx10360\tx11520\fc0 1.797693134862316e+308
  74. \pard\tx960\tx1920\tx2880\tx3840\tx4800\tx5760\tx6720\tx7680\tx8640\tx9600 \
  75. \
  76. • The 
  77. \b unsigned
  78. \b0  and 
  79. \b signed 
  80. \b0 keywords don't change the size of the type they qualify.  \
  81. • Pointers occupy 4 bytes.\
  82. • The 
  83. \b void 
  84. \b0 type occupies no space.  \
  85. \
  86. If you happen to forget any of the sizes, you can quickly remind yourself by running gdb and typing:\
  87.     print sizeof(
  88. \i type
  89. \i0 )\
  90.     
  91. \fc0 \
  92. The minimum and maximum values are defined as constants in 
  93. \b <limits.h>
  94. \b0  and 
  95. \b <float.h>
  96. \b0 .\
  97. \
  98. QA808\
  99. \
  100. Valid for 1.0\
  101. Valid for 2.0\
  102. \
  103.  
  104.